package com.maxvision.mybatis.converter;

import cn.hutool.core.io.FileUtil;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.Converter;
import org.springframework.stereotype.Component;

import java.io.File;

/**
 * 类说明
 *
 * @author HuangRongFu
 * @date 2023/2/20
 */
@Component
public class StringFileConverter implements Converter<File,String> {
    
    @Override
    public String convert(File file) {

        String fileStr = FileUtil.readUtf8String(file);
        return fileStr;
    }

    @Override
    public JavaType getInputType(TypeFactory typeFactory) {
        return null;
    }

    @Override
    public JavaType getOutputType(TypeFactory typeFactory) {
        return null;
    }
}
